import React from 'react'
import config from 'config'
import { messages } from 'share/common'

const searcherData = {
  'proxy_form': { //参数customFormType：1001 申请单 1002 报销单
    title: messages('components.key396'/*选择代理单据*/), //选择代理单据
    url: `${config.baseUrl}/api/billProxyRule/proxy/forms/audit/search`,
    key: 'formOID'
  },
  'proxy_form_apply': { //员工代理制单，选择单据，参数formType：101：申请单表单，102：报销单表单,  104：借款单表单,  103：所有 代理制单
    title: messages('components.key396'/*选择代理单据*/), //选择代理单据
    url: `${config.baseUrl}/api/billProxyRule/proxy/forms/search`,
    key: 'formOID'
  },
  'proxy_form_admin': { //参数customFormType：1001 申请单 1002 报销单
    title: messages('components.key396'/*选择代理单据*/), //选择代理单据
    url: `${config.baseUrl}/api/custom/forms/proxy`,
    key: 'formOID'
  },
  // 查询帐套级时，传setOfBooksId, formTypeList
  // 查公司级时，传setOfBooksId, companyOID, formTypeList
  'form_tenant_company': {
    title: messages('components.key977')/*选择适用表单*/,
    url: `${config.baseUrl}/api/custom/forms/loan/reference`,
    key: 'formOID'
  },
  'auto_credit_rule': {//自动信用规则项
    title: messages('components.key839')/*选择规则项*/,
    url: `${config.baseUrl}/api/credit/auto/{ruleSetId}/conditions`,
    key: 'conditionCode'
  },
  'corporation_entity': {
    title: messages('components.key397'/*选择法人实体*/), //选择法人实体
    url: `${config.baseUrl}/api/all/company/receipted/invoices`,
    key: 'companyReceiptedOID'
  },
  'department_role': {
    title: messages('common.please.select'),
    url: `${config.baseUrl}/api/departmentposition`,
    key: 'positionCode'
  },
  'currency': { //参数 companyOID
    title: messages('common.please.select'),
    url: `${config.baseUrl}/api/get/exchange/rate`,
    key: 'currencyCode'
  },
  'department': {
    title: messages('components.key551')/*选择部门*/,
    url: `${config.baseUrl}/api/departments/root/v2`,
    key: 'departmentOID'
  },
  'all_department':{
    title: messages('components.key551')/*选择部门*/,
    url: `${config.baseUrl}/api/department/like`,
    key: 'departmentOID'
  },
  'cost_center_item': {
    title: messages('components.key719')/*成本中心项*/,
    url: `${config.baseUrl}/api/cost/center/items/{costCenterOID}/all`,
    key: 'id'
  },
  'user_group': {
    title: messages('components.key203')/*人员组*/,
    url: `${config.baseUrl}/api/user/groups/company`,
    key: 'id'
  },
  'country': {
    title: messages('components.key527')/*国家*/,
    url: `${config.baseUrl}/api/areas/international/list`,
    key: 'code'
  },
  'city_level': {
    title: messages('components.key720')/*城市组*/,
    url: `${config.baseUrl}/api/levels/my`,
    key: 'id'
  },
  'enumerations': {
    title: messages('components.key721')/*值列表*/,
    url: `${config.baseUrl}/api/custom/enumerations/{enumerationOID}/items/by/user`,
    key: 'value'
  },
  //登录员工含权限的所有表单 在审核、付款、查看页面用到 1001借款单 1002报销单
  'authority_form': {
    title: messages('components.key745')/*选择表单类型*/,
    url: `${config.baseUrl}/api/custom/forms/finance/all?showCompany=true`,
    key: 'formOID'
  },
  //信用模型
  'credit_model_list': {
    title: messages('components.key1017')/*请选择信用模型*/,
    url: `/api/credit/all/model`,
    key: 'id'
  },
  'expense_label': {
    title: messages('common.label'/*"标签"*/),
    url: '/api/expense/labels',
    key: 'id'
  },
  'labels': {
    title: messages('common.label'/*"标签"*/),
    url: '/api/labels',
    key: 'type',
    listKey: 'rows'
  },
  'vicp_titles': {
    title: messages('components.key1018')/*抬头*/,
    url: '/receipt/api/receipt/vicp/titles',
    service: list => [...new Set(list)]
      .sort(item => item === '' ? 1 : -1)
      .map(item => ({ key: item || messages('components.key1049')/*(空值)*/ }))
    ,
    key: 'key',
    listKey: 'rows'
  },
  'user_group_book': {
    title: messages('components.key203')/*人员组*/,
    url: `/api/user/groups/search`,
    key: 'id'
  },
  'car_by_user': {
    title: messages('components.key1328')/*司机车牌*/,
    url: `${config.baseUrl}/api/car/getCarByApprovalEmployeeID`,
    key: 'id'
  }
};

export default searcherData;
